<div class="user-r-title clearfix">
    <div class="common-title f-l">
        <span>推广会员：{$data.user.nick_name}</span>
        <span>上线推广商：{$data.p_user.name}</span>
    </div>
    <a href="javascript:history.go(-1);" class="btn btn-primary btn-m f-r" id="btn_upload">返回</a>
</div>
<div class="user-r-content clearfix j-ajax-page">
    <div class="search clearfix" ms-important="vm-search">
        <div class="search-list">
            <span>时间</span>
            <input type="text" ms-duplex="@search_data.begin_time" id="begin_time" placeholder="{$data.begin_time}"> <span>-</span> <input type="text" ms-duplex="@search_data.end_time" id="end_time" placeholder="{$data.end_time}">
        </div>
        <div class="search-list">
            <span>游戏类型</span>
            <select name="game_id" ms-duplex="@search_data.game_id">
                <option value="0">全部</option>
                {foreach from="$data.game_array" item="game" key="key"}
                {if $key eq $data.game_id}
                <option value="{$key}" selected="selected">{$game}</option>
                {else}
                <option value="{$key}">{$game}</option>
                {/if}
                {/foreach}
            </select>
        </div>
        <div class="search-list">
            <span>胜负</span>
            <select name="is_win" ms-duplex="@search_data.is_win">
                <option value="0">全部</option>
                <option value="1"{if 1 eq $data.is_win} selected="selected"{/if}>赢</option>
                <option value="-1"{if -1 eq $data.is_win} selected="selected"{/if}>输</option>
            </select>
        </div>
        <a href="javascript:void(0)" class="btn btn-primary btn-circle" ms-click="search">搜索</a>
    </div>
    <div class="ajax-block">
        <table class="uc-table">
            <thead>
                <tr>
                    <th>时间</th>
                    <th>游戏类型</th>
                    <th>下注金额</th>
                    <th>胜负</th>
                    <th>游戏流水</th>
                    <th>推广中心流水收入</th>
                    <th>平台流水收入</th>
                    <th>会员收支</th>
                    <th>推广商的收支</th>
                </tr>
            </thead>
            <tbody>
                {foreach from="$data.gift_list" item="log"}
                <tr>
                    <td>{function name="to_date" v=$log.create_time}</td>
                    <td>{$log.game_id}</td>
                    <td>{$log.sum_bet}</td>
                    <td>{if $log.sum_win gt 0}胜{else}负{/if}</td>
                    <td>{function name="abs" v=$log.sum_win}</td>
                    <td>{$log.promoter_gain}</td>
                    <td>{$log.platform_gain}</td>
                    <td>{$log.user_gain}</td>
                    <td>{$log.gain}</td>
                </tr>
                {foreachelse}
                <tr>
                    <td colspan="9">
                        <span>暂无数据</span>
                    </td>
                </tr>
                {/foreach}
                {if $data.gift_list}
                <tr class="form-body form-total">
                    <td class="content-font">合计</td>
                    <td class="content-font"></td>
                    <td class="content-font">{$data.sum.sum_bet}</td>
                    <td class="content-font"></td>
                    <td class="content-font">{$data.sum.sum_win}</td>
                    <td class="content-font">{$data.sum.promoter_gain}</td>
                    <td class="content-font">{$data.sum.platform_gain}</td>
                    <td class="content-font">{$data.sum.user_gain}</td>
                    <td class="content-font">{$data.sum.gain}</td>
                </tr>
                {/if}
            </tbody>
        </table>
        <div class="m-page clearfix">
            <div class="m-page-con">
                {$data.page}
            </div>
        </div>
    </div>
</div>